package com.itheima_8;
import java.io.*;
import java.net.Socket;

public class ClientDemo extends Thread{
    static File srcFile=new File("D:\\A.log");
    public static void main(String[] args) throws IOException {
        Socket socket=new Socket("127.0.0.1",10012);
        InputStream is=socket.getInputStream();
        BufferedReader br=new BufferedReader(new InputStreamReader(is));
        String s = br.readLine();
        System.out.println(s);
        BufferedReader br1=new BufferedReader(new InputStreamReader(is));
        BufferedWriter bw =new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()));
        String str;
        while ((str=br1.readLine())!=null){
            bw.write(str);
            bw.newLine();
            bw.flush();
        }
        socket.shutdownOutput();
    }
}
